package appapi.service.impl;

import appapi.dao.DevicesMapper;
import appapi.entity.mqtt.Devices;
import appapi.service.DevicesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-07-05 10:33
 */
@Service
public class DevicesServiceImpl implements DevicesService {


    @Autowired
    private DevicesMapper devicesMapper;

    @Override
    public void insertDevices(Devices devices) {
        devicesMapper.insertDevices(devices);
    }

    @Override
    public void updateDevices(Devices devices) {
        devicesMapper.updateDevices(devices);
    }

    @Override
    public void deleteDevices(Long devicesId) {
        devicesMapper.deleteDevices(devicesId);
    }

    @Override
    public Devices getDevicesById(Long devicesId) {
        return devicesMapper.getDevicesById(devicesId);
    }


    @Override
    public List<Devices> getAll(Devices devices) {
        return devicesMapper.getAll(devices);
    }

    @Override
    public void deleteDeviceByRegion(Long devicesId, String address) {
        devicesMapper.deleteDeviceByRegion(devicesId, address);
    }
}